$(function() {
    $('#login').on('click',function() {
        const username = $('#username').val().trim()
        const password = $('#password').val().trim()
        // console.log(username,password);
        $.post("http://localhost:8080/api/v1/admin/user/login",{username,password},function(res) {
            if (res.code == 200) {
                localStorage.setItem('token',res.token)
                location.assign('index.html')
            } else {
                alert(res.msg)
            }
        })
    })
})